﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Documents;

namespace WPFMultitouchDemo.Adorners
{
    public class PhotoAdorner : Adorner
    {
        // Be sure to call the base class constructor.
        public PhotoAdorner(UIElement adornedElement)
            : base(adornedElement)
        {
        }

        // A common way to implement an adorner's rendering behavior is to override the OnRender
        // method, which is called by the layout system as part of a rendering pass.
        protected override void OnRender(DrawingContext drawingContext)
        {
            Rect adornedRect = new Rect(this.AdornedElement.DesiredSize);

            // Some arbitrary drawing implements.
            RadialGradientBrush renderBrush = new RadialGradientBrush(Colors.White, Colors.Gray) ;

            // draw the top rectangle
            drawingContext.DrawEllipse(renderBrush, null, new Point(adornedRect.Right, adornedRect.Top),
                15, 15);
        }
   }
}
